package com.jy.appmarket.statistics.umeng;

import java.util.HashMap;
import java.util.Map;

import com.umeng.analytics.MobclickAgent;

import android.content.Context;

public class myUmengStaticstics {
	
	public static void onWidgetEnable(Context context, String type){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		MobclickAgent.onEvent(context, "widgetEnable", map);
	}
	
	public static void onWidgetDisable(Context context, String type){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		MobclickAgent.onEvent(context, "widgetDisable", map);
	}
	
	public static void ClickWidget(Context context, String type){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		MobclickAgent.onEvent(context, "widgetClick", map);
	}
	
	public static void getNetworkDataResult(Context context, String command, String Status){
		Map<String, String> map = new HashMap<String, String>();
		map.put("result", command+":"+Status);
		MobclickAgent.onEvent(context, "getnetdataresult", map);
	}
	
	public static void widgetItemClick(Context context, String from, String item, String status){
		Map<String, String> map = new HashMap<String, String>();
		map.put("from", from);
		map.put("item", item+":"+status);
		MobclickAgent.onEvent(context, "widgetitemclick", map);
	}
	
	public static void startDownload(Context context, String from, String packagename){
		Map<String, String> map = new HashMap<String, String>();
		//map.put("from", from);
		map.put("package", packagename);
		MobclickAgent.onEvent(context, "newdownload", map);
	}
	
	public static void continueDownload(Context context, String from, String packagename){
		Map<String, String> map = new HashMap<String, String>();
		//map.put("from", from);
		map.put("package", packagename);
		MobclickAgent.onEvent(context, "continuedownload", map);
	}
	
	public static void stopDownload(Context context, String from, String packagename,String reason){
		Map<String, String> map = new HashMap<String, String>();
		//map.put("from", from);
		map.put("package", packagename);
		map.put("reason", reason);
		MobclickAgent.onEvent(context, "stopdownload", map);
	}
	
	public static void waitWifiDownload(Context context, String from, String packagename){
		Map<String, String> map = new HashMap<String, String>();
		//map.put("from", from);
		map.put("package", packagename);
		MobclickAgent.onEvent(context, "waitwifidownload", map);
	}
	
	public static void widgetStartDownload(Context context, String from, String packagename){
		Map<String, String> map = new HashMap<String, String>();
		map.put("from", from);
		map.put("package", packagename);
		MobclickAgent.onEvent(context, "widgetnewdownload", map);
	}
	
	public static void widgetContinueDownload(Context context, String from, String packagename){
		Map<String, String> map = new HashMap<String, String>();
		map.put("from", from);
		map.put("package", packagename);
		MobclickAgent.onEvent(context, "widgetcontinuedownload", map);
	}
	
	public static void widgetStopDownload(Context context, String from, String packagename, String reason){
		Map<String, String> map = new HashMap<String, String>();
		map.put("from", from);
		map.put("package", packagename);
		map.put("reason", reason);
		MobclickAgent.onEvent(context, "widgetstopdownload", map);
	}
	
	public static void widgetSuccessDownload(Context context, String from, String packagename){
		Map<String, String> map = new HashMap<String, String>();
		map.put("from", from);
		map.put("package", packagename);
		MobclickAgent.onEvent(context, "widgetsuccessdownload", map);
	}
	
	public static void successDownload(Context context, String from, String packagename){
		Map<String, String> map = new HashMap<String, String>();
		//map.put("from", from);
		map.put("package", packagename);
		MobclickAgent.onEvent(context, "successdownload", map);
	}
	
	public static void receivePassTimePush(Context context, String type){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		MobclickAgent.onEvent(context, "passtimepush", map);
	}
	
	public static void receivePush(Context context, String type){
		Map<String, String> map = new HashMap<String, String>();
		map.put("type", type);
		MobclickAgent.onEvent(context, "receivepush", map);
	}
	
	public static void openPush(Context context){
		MobclickAgent.onEvent(context, "openpush");
	}
	
	//安装
	public static void installapk(Context context, String from, String pkgname, String type){
		Map<String, String> map = new HashMap<String ,String>();
		//map.put("from", from);
		map.put("package", pkgname);
		map.put("type", type);
		MobclickAgent.onEvent(context, "install", map);
	}
	
	public static void installSuccess(Context context, String pkgname){
		Map<String, String> map = new HashMap<String ,String>();
		map.put("package", pkgname);
		MobclickAgent.onEvent(context, "installsuccess", map);
	}
	
	public static void onSearch(Context context){
		MobclickAgent.onEvent(context, "search");
	}
	
	public static void onGetDriftIcon(Context context){
		MobclickAgent.onEvent(context, "getdrifticon");
	}
	
	public static void onShowDriftIcon(Context context){
		MobclickAgent.onEvent(context, "showdrifticon");
	}
	
	public static void onClickDriftIcon(Context context){
		MobclickAgent.onEvent(context, "clickdrifticon");
	}
	
	public static void onGetEscRecommend(Context context){
		MobclickAgent.onEvent(context, "getescrecommend");
	}
	
	public static void onShowEscRecommend(Context context){
		MobclickAgent.onEvent(context, "showescrecommend");
	}
	
	public static void clickEscRecommendbanner(Context context){
		MobclickAgent.onEvent(context, "clickescrecommendban");
	}
	
	public static void clickEscRecommendCancel(Context context){
		MobclickAgent.onEvent(context, "clickescrecommendcancel");
	}
	
	public static void clickEscRecommendConfirm(Context context){
		MobclickAgent.onEvent(context, "clickescrecommendconfirm");
	}
	
	public static void clickSearchShortCut(Context context){
		MobclickAgent.onEvent(context, "clicksearchshortcut");
	}
	
	//showMode: view/activity
	public static void screenLock(Context context, String showMode){
		Map<String, String> map = new HashMap<String ,String>();
		map.put("showmode", showMode);
		MobclickAgent.onEvent(context, "screenlock", map);
	}
	
	public static void screenUnlock(Context context, String showMode){
		Map<String, String> map = new HashMap<String ,String>();
		map.put("showmode", showMode);
		MobclickAgent.onEvent(context, "screenunLock", map);
	}
}
